<?php

use App\Http\Controllers\ActionLogController;
use App\Http\Controllers\AdController;
use App\Http\Controllers\AdSortController;
use App\Http\Controllers\ArticleController;
use App\Http\Controllers\CityController;
use App\Http\Controllers\ConfigDataController;
use App\Http\Controllers\ConfigController;
use App\Http\Controllers\ConfigWebController;
use App\Http\Controllers\Demo3Controller;
use App\Http\Controllers\DeptController;
use App\Http\Controllers\DictDataController;
use App\Http\Controllers\DictController;
use App\Http\Controllers\ExampleController;
use App\Http\Controllers\GenerateController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\ItemCateController;
use App\Http\Controllers\ItemController;
use App\Http\Controllers\LayoutController;
use App\Http\Controllers\LayoutDescController;
use App\Http\Controllers\LevelController;
use App\Http\Controllers\LinkController;
use App\Http\Controllers\LoginLogController;
use App\Http\Controllers\MemberController;
use App\Http\Controllers\MemberLevelController;
use App\Http\Controllers\MenuController;
use App\Http\Controllers\NoticeController;
use App\Http\Controllers\OrganizationController;
use App\Http\Controllers\PositionController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\UploadController;
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\CategoryController;
use App\Http\Controllers\BrandsController;
use App\Http\Controllers\BomsController;
use App\Http\Controllers\ProductTypesController;
use App\Http\Controllers\ProductsController;
use App\Http\Controllers\QrCodesController;
use App\Http\Controllers\CustomersController;
use App\Http\Controllers\CustomerUsersController;
use App\Http\Controllers\QrCodeFrontController;
use App\Http\Controllers\AccountController;
use App\Http\Controllers\VerifyCodesController;
use App\Http\Controllers\FilesController;
use App\Http\Controllers\ScreensController;
use App\Http\Controllers\QrCodeScanController;
use App\Http\Controllers\WorkOrdersController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\EventsController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\CommonController;
use App\Http\Controllers\PushController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\CustomerEventsController;
use App\Http\Controllers\ExcelTemplateController;
use App\Http\Controllers\ImportController;
use App\Http\Controllers\AttendanceController;
use App\Http\Controllers\ProjectsController;
use App\Http\Controllers\TaskController;
use App\Http\Controllers\MapController;
use App\Http\Controllers\ReportsController;
use App\Http\Controllers\AppVersionController;
use App\Http\Controllers\TestsController;
use App\Http\Controllers\RegisterController;
use App\Http\Controllers\WarehousesController;
use App\Http\Controllers\PartCategoryController;
use App\Http\Controllers\InventoriesController;
use App\Http\Controllers\SuggestsController;
use App\Http\Controllers\QuestionFeedbacksController;
use App\Http\Controllers\QuantityUsersController;
use App\Http\Controllers\SettingController;
use App\Http\Controllers\DepartmentsController;
use App\Http\Controllers\PollingController;
use App\Http\Controllers\PollingPlanController;

/*
|----
| Web Routes
|----
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// 按模块对数据进行权限验证
Route::group(['middleware' => ['module.auth']], function () {
    // excel 模板下载
    Route::get('template/customer', [ExcelTemplateController::class, 'customer']);
    Route::get('template/product', [ExcelTemplateController::class, 'product']);
    Route::get('template/project_product', [ExcelTemplateController::class, 'project_product']);
    // 数据导入
    Route::post('import/customer', [ImportController::class, 'customer']);
    Route::post('import/product', [ImportController::class, 'product']);
    Route::post('import/project_product', [ImportController::class, 'project_product']);

    // 签到签退
    Route::post('attendance', [AttendanceController::class, 'store']);
    Route::get('attendance/page', [AttendanceController::class, 'page']);
    Route::get('attendance/{attendanceId}', [AttendanceController::class, 'show']);
    Route::get('attendance/work_order/{work_order_id}', [AttendanceController::class, 'byWorkOrderId']);

    // 项目
    Route::get('projects_collect', [ProjectsController::class, 'projects_collect'])->name('projects.collect');
    Route::prefix('projects')->group(function () {
        Route::get('', [ProjectsController::class, 'index'])->name('projects.index');
        Route::post('', [ProjectsController::class, 'store'])->name('projects.store');
        Route::get('params', [ProjectsController::class, 'params'])->name('projects.params');
        Route::get('type_tasks', [ProjectsController::class, 'type_tasks'])->name('projects.type_tasks');
        Route::get('simple', [ProjectsController::class, 'simple'])->name('projects.simple');
        Route::get('/over_view', [ProjectsController::class, 'over_view'])->name('projects.over_view');
        Route::get('/{id}', [ProjectsController::class, 'show'])->name('projects.show');
        Route::put('/{id}', [ProjectsController::class, 'update'])->name('projects.update');
        Route::post('/{id}/start', [ProjectsController::class, 'start'])->name('projects.start');
        Route::post('/{id}/re_start', [ProjectsController::class, 're_start'])->name('projects.re_start');
        Route::post('/{id}/close', [ProjectsController::class, 'close'])->name('projects.close');
        Route::post('/{id}/complete', [ProjectsController::class, 'complete'])->name('projects.complete');
        Route::post('/{id}/filing', [ProjectsController::class, 'filing'])->name('projects.filing');
        Route::post('/{id}/products', [ProjectsController::class, 'products'])->name('projects.products');
        Route::get('/{id}/products', [ProjectsController::class, 'products_list'])->name('projects.products_list');
        Route::get('/{id}/work_day', [ProjectsController::class, 'work_day'])->name('projects.work_day');
        Route::get('/{id}/total_task', [ProjectsController::class, 'total_task'])->name('projects.total_task');
        Route::get('/{id}/task_complete_counts', [ProjectsController::class, 'task_complete_counts'])->name('projects.task_complete_counts');
        Route::get('/{id}/burn_down', [ProjectsController::class, 'burn_down'])->name('projects.burn_down');
        Route::post('/products_unbind', [ProjectsController::class, 'products_unbind'])->name('projects.products_unbind');
        Route::get('/{id}/schedule_total_task', [ProjectsController::class, 'schedule_total_task'])->name('projects.schedule_total_task');
        Route::delete('/{id}', [ProjectsController::class, 'destroy'])->name('projects.destroy');
        Route::prefix('gantt')->group(function () {
            Route::get('projects', [ProjectsController::class, 'gantt_projects'])->name('projects.gantt_projects');
            Route::get('data', [ProjectsController::class, 'gantt_data'])->name('projects.gantt_data');
        });
    });

    // 任务
    Route::prefix('tasks')->group(function () {
        Route::post('', [TaskController::class, 'store'])->name('tasks.store');
        Route::post('{id}/start', [TaskController::class, 'start'])->name('tasks.start');
        Route::post('{id}/complete', [TaskController::class, 'complete'])->name('tasks.complete');
        Route::post('{id}/close', [TaskController::class, 'close'])->name('tasks.close');
        Route::get('types', [TaskController::class, 'types'])->name('tasks.types');
        Route::get('status', [TaskController::class, 'status'])->name('tasks.status');
        Route::get('', [TaskController::class, 'index'])->name('tasks.index');
        Route::get('{id}/products', [TaskController::class, 'products'])->name('tasks.products');
        Route::put('{id}', [TaskController::class, 'update'])->name('tasks.update');
        Route::get('{id}', [TaskController::class, 'fetch'])->name('tasks.fetch');
        Route::delete('{id}', [TaskController::class, 'destroy'])->name('tasks.delete');
    });
    Route::get('tasks_all', [TaskController::class, 'list_all'])->name('tasks.list_all');

    // 报表
    Route::prefix('reports')->group(function () {
        Route::get('/zones', [ReportsController::class, 'zones'])->name('reports.zones');
        Route::get('/task_review', [ReportsController::class, 'task_review'])->name('reports.task_review');
        Route::get('/service_person', [ReportsController::class, 'service_person'])->name('reports.service_person');
        Route::get('/avg_service_time', [ReportsController::class, 'avg_service_time'])->name('reports.avg_service_time');
        Route::get('/zone_work_order', [ReportsController::class, 'zone_work_order'])->name('reports.zone_work_order');
        Route::get('/person_work_order', [ReportsController::class, 'person_work_order'])->name('reports.person_work_order');
        Route::get('/close_work_order', [ReportsController::class, 'close_work_order'])->name('reports.close_work_order');
        Route::get('/customer_satisfaction', [ReportsController::class, 'customer_satisfaction'])->name('reports.customer_satisfaction');
        Route::get('/work_order_aging', [ReportsController::class, 'work_order_aging'])->name('reports.work_order_aging');
        Route::get('/work_order_tendency', [ReportsController::class, 'work_order_tendency'])->name('reports.work_order_tendency');
        Route::get('/satisfaction_probability', [ReportsController::class, 'satisfaction_probability'])->name('reports.satisfaction_probability');
        Route::get('/suggest', [ReportsController::class, 'suggest'])->name('reports.suggest');
        Route::get('avg_response', [ReportsController::class, 'avg_response'])->name('reports.avg_response');
        Route::get('avg_response_detail', [ReportsController::class, 'avg_response_detail'])->name('reports.avg_response_detail');
        Route::get('repeat_repair', [ReportsController::class, 'repeat_repair'])->name('reports.repeat_repair');
        Route::get('repeat_repair_detail', [ReportsController::class, 'repeat_repair_detail'])->name('reports.repeat_repair_detail');
        Route::get('wo_receipt', [ReportsController::class, 'wo_receipt'])->name('reports.wo_receipt');
        Route::get('wo_receipt_detail', [ReportsController::class, 'wo_receipt_detail'])->name('reports.wo_receipt_detail');
    });

    // app版本
    Route::prefix('app_version')->group(function () {
        Route::get('/android', [AppVersionController::class, 'android'])->name('app_version.android');
        Route::get('/ios', [AppVersionController::class, 'ios'])->name('app_version.ios');
    });

    // 工单
    Route::prefix('wos')->group(function () {
        Route::get('', [WorkOrdersController::class, 'index']);
        Route::post('', [WorkOrdersController::class, 'store']);
        Route::get('status_counts', [WorkOrdersController::class, 'status_counts']);
        Route::get('params', [WorkOrdersController::class, 'params']);
        Route::get('{id}', [WorkOrdersController::class, 'show']);
        Route::get('{id}/audit_show', [WorkOrdersController::class, 'audit_show']);
        Route::get('{id}/callback_show', [WorkOrdersController::class, 'callback_show']);
        Route::post('{id}/accept', [WorkOrdersController::class, 'accept']);
        Route::post('{id}/start', [WorkOrdersController::class, 'start']);
        Route::post('{id}/receipt', [WorkOrdersController::class, 'receipt']);
        Route::post('{id}/allot', [WorkOrdersController::class, 'allot']);
        Route::post('{id}/audit', [WorkOrdersController::class, 'audit']);
        Route::post('{id}/callback', [WorkOrdersController::class, 'callback']);
        Route::post('{id}/close', [WorkOrdersController::class, 'close']);
        Route::post('{id}/reassigned', [WorkOrdersController::class, 'reassigned']);
        Route::post('{id}/reassigned_apply', [WorkOrdersController::class, 'reassigned_apply']);
    });
    Route::get('wo_rankings', [WorkOrdersController::class, 'rankings']);
    Route::get('wo_count_statistic', [WorkOrdersController::class, 'count_statistic']);

    // 仓库
    Route::prefix('warehouses')->group(function () {
        Route::post('', [WarehousesController::class, 'store'])->name('warehouses.store');
        Route::get('/{id}', [WarehousesController::class, 'show'])->name('warehouses.show');
        Route::put('/{id}', [WarehousesController::class, 'update'])->name('warehouses.update');
        Route::get('', [WarehousesController::class, 'index'])->name('warehouses.index');
    });

    // 配件品类
    Route::prefix('part_categories')->group(function () {
        Route::get('/params', [PartCategoryController::class, 'params'])->name('part_category.params');
        Route::post('', [PartCategoryController::class, 'store'])->name('part_category.store');
        Route::get('', [PartCategoryController::class, 'index'])->name('part_category.index');
        Route::get('/{id}', [PartCategoryController::class, 'show'])->name('part_category.index');
        Route::delete('/{id}', [PartCategoryController::class, 'destroy'])->name('part_category.destroy');
        Route::put('/{id}', [PartCategoryController::class, 'update'])->name('part_category.update');
        Route::post('/{id}/active', [PartCategoryController::class, 'active'])->name('part_category.active');
        Route::post('/{id}/inactive', [PartCategoryController::class, 'inactive'])->name('part_category.inactive');
    });

    // 库存
    Route::prefix('inventories')->group(function () {
        Route::get('/params', [InventoriesController::class, 'params'])->name('inventory.params');
        Route::get('', [InventoriesController::class, 'index'])->name('inventory.index');
        Route::get('/{id}', [InventoriesController::class, 'show'])->name('inventory.show');
        Route::post('/batch_storage', [InventoriesController::class, 'batch_storage'])->name('inventory.batch_inventory');
        Route::post('/single_storage', [InventoriesController::class, 'single_storage'])->name('inventory.single_storage');
        Route::post('/{id}/safe_quantity', [InventoriesController::class, 'safe_quantity'])->name('inventory.safe_quantity');
        Route::post('/batch_out', [InventoriesController::class, 'batch_out'])->name('inventory.batch_out');
        Route::post('/single_out', [InventoriesController::class, 'single_out'])->name('inventory.single_out');
        Route::post('/allot', [InventoriesController::class, 'allot'])->name('inventory.allot');
        Route::post('/apply', [InventoriesController::class, 'apply'])->name('inventory.apply');
    });
    Route::get('/warehouse_inventories', [InventoriesController::class, 'warehouse_inventories'])->name('inventory.warehouse_inventories');
    Route::get('/inventories_audit', [InventoriesController::class, 'audit'])->name('inventory.audit');
    Route::get('/inventories_audit_counts', [InventoriesController::class, 'counts'])->name('inventory.counts');
    Route::get('/inventory_audit_status', [InventoriesController::class, 'inventory_audit_status'])->name('inventory.audit_status');
    Route::get('/inventories_audit/{id}', [InventoriesController::class, 'audit_detail'])->name('inventory.audit_detail');
    Route::post('/inventories_audit/{id}/accept', [InventoriesController::class, 'audit_accept'])->name('inventory.audit_accept');
    Route::post('/inventories_audit/{id}/reject', [InventoriesController::class, 'audit_reject'])->name('inventory.audit_reject');
    Route::post('/inventories_audit/{id}/cancel', [InventoriesController::class, 'audit_cancel'])->name('inventory.audit_cancel');

    Route::get('/user_inventories', [InventoriesController::class, 'userInventories'])->name('inventory.user_inventory');
    Route::post('/user_inventories/{id}/back', [InventoriesController::class, 'userInventoryBack'])->name('inventory.user_inventory_back');

    Route::post('/inventories_allocation', [InventoriesController::class, 'allocation'])->name('inventory.allocation');

    // 通知
    Route::prefix('notifications')->group(function () {
        Route::get('', [NotificationController::class, 'index']);
        Route::get('status_count', [NotificationController::class, 'status_count']);
        Route::post('store_test', [NotificationController::class, 'store_test']);
        Route::post('read_all', [NotificationController::class, 'read_all']);
        Route::post('{id}/mark_read', [NotificationController::class, 'mark_read']);
    });

    // 意见反馈
    Route::prefix('suggests')->group(function () {
        Route::get('params', [SuggestsController::class, 'params'])->name('suggest.params');
        Route::get('export', [SuggestsController::class, 'export'])->name('suggest.export');
        Route::post('', [SuggestsController::class, 'store'])->name('suggest.store');
        Route::get('', [SuggestsController::class, 'index'])->name('suggest.index');
        Route::get('{id}', [SuggestsController::class, 'show'])->name('suggest.show');
        Route::put('{id}', [SuggestsController::class, 'modify'])->name('suggest.modify');
        Route::post('{id}/resolve', [SuggestsController::class, 'resolve'])->name('suggest.resolve');
        Route::post('{id}/close', [SuggestsController::class, 'close'])->name('suggest.close');
        Route::delete('{id}', [SuggestsController::class, 'destroy'])->name('suggest.destroy');
    });

    // 质量反馈
    Route::prefix('question_feedback')->group(function () {
        Route::get('params', [QuestionFeedbacksController::class, 'params'])->name('question_feedback.params');
        Route::post('', [QuestionFeedbacksController::class, 'store'])->name('question_feedback.store');
        Route::get('', [QuestionFeedbacksController::class, 'index'])->name('question_feedback.index');
        Route::get('un_process_count', [QuestionFeedbacksController::class, 'un_process_count'])->name('question_feedback.un_process_count');
        Route::get('{id}', [QuestionFeedbacksController::class, 'show'])->name('question_feedback.show');
        Route::post('{id}/audit', [QuestionFeedbacksController::class, 'audit'])->name('question_feedback.audit');
        Route::post('{id}/quantity_audit', [QuestionFeedbacksController::class, 'quantity_audit'])->name('question_feedback.quantity_audit');
        Route::post('{id}/action', [QuestionFeedbacksController::class, 'action'])->name('question_feedback.action');
        Route::post('{id}/close', [QuestionFeedbacksController::class, 'close'])->name('question_feedback.close');
    });

    Route::get('quantity_users', [QuantityUsersController::class, 'index'])->name('quantity_user.index');

    // 配置项
    Route::prefix('settings')->group(function () {
        Route::get('', [SettingController::class, 'index'])->name('setting.get_all');
        Route::get('keys', [SettingController::class, 'keys'])->name('setting.keys');
        Route::put('', [SettingController::class, 'update'])->name('setting.update');
    });

    // 部门
    Route::prefix('department')->group(function () {
        Route::get('{id}/all_child', [DepartmentsController::class, 'all_child'])->name('department.all_child');
    });

    // 巡检任务
    Route::prefix('pollings')->group(function () {
        Route::post('', [PollingController::class, 'store'])->name('polling.store');
        Route::get('', [PollingController::class, 'index'])->name('polling.index');
        Route::get('params', [PollingController::class, 'params'])->name('polling.params');
        Route::get('counts', [PollingController::class, 'counts'])->name('polling.counts');
        Route::get('{id}', [PollingController::class, 'show'])->name('polling.show');
        Route::delete('{id}', [PollingController::class, 'delete'])->name('polling.delete');
        Route::get('{id}/process', [PollingController::class, 'process'])->name('polling.process');
        Route::post('{id}/accept', [PollingController::class, 'accept'])->name('polling.accept');
        Route::post('{id}/start', [PollingController::class, 'start'])->name('polling.start');
        Route::post('{id}/receipt', [PollingController::class, 'receipt'])->name('polling.receipt');
    });

    // 巡检计划
    Route::prefix('polling_plan')->group(function () {
        Route::get('', [PollingPlanController::class, 'index'])->name('polling_plan.index');
        Route::post('', [PollingPlanController::class, 'store'])->name('polling_plan.store');
        Route::get('params', [PollingPlanController::class, 'params'])->name('polling_plan.params');
        Route::get('{id}', [PollingPlanController::class, 'show'])->name('polling_plan.show');
        Route::get('{id}/logs', [PollingPlanController::class, 'logs'])->name('polling_plan.logs');
        Route::put('{id}', [PollingPlanController::class, 'update'])->name('polling_plan.update');
        Route::delete('{id}', [PollingPlanController::class, 'destroy'])->name('polling_plan.destroy');
        Route::post('{id}/pause', [PollingPlanController::class, 'pause'])->name('polling_plan.pause');
        Route::post('{id}/start', [PollingPlanController::class, 'start'])->name('polling_plan.start');
    });
});

// 测试
Route::prefix('tests')->group(function () {
    Route::get('notify', [TestsController::class, 'notify'])->name('tests.notify');
    Route::get('route', [TestsController::class, 'route'])->name('tests.route');
});

Route::get('/', function () {
    return view('welcome');
});

// 地图 json 数据
Route::prefix('map')->group(function () {
    Route::get('china', [MapController::class, 'china'])->name('map.china');
    Route::get('world', [MapController::class, 'world'])->name('map.world');
});

Route::get('qrcode', [QrCodeFrontController::class, 'index']);
Route::get('qrcode/repair', [QrCodeFrontController::class, 'repair']);
Route::post('qrcode/store', [QrCodeFrontController::class, 'store']);
Route::get('account/login', [AccountController::class, 'login']);
Route::get('account/storage_user', [AccountController::class, 'storageUser']);
Route::post('verify_code', [VerifyCodesController::class, 'index']);
Route::post('verify_code_pwd', [VerifyCodesController::class, 'resetPassword']);
Route::post('files/filesStore', [FilesController::class, 'store']);
Route::get('city/index', [CityController::class, 'index']);

Route::get('push', [PushController::class, 'index']);

// 系统登录
Route::get('/captcha', [LoginController::class, 'captcha'])->name('captcha');
Route::post('/login', [LoginController::class, 'login']);
Route::post('/login/account', [LoginController::class, 'account']);
Route::get('/logout', [LoginController::class, 'logout']);

// 重置密码
Route::post("/user/reset_password", [\App\Http\Controllers\JosemUserController::class, 'resetPassword'])->name('user.reset_password');

// 账号注册
Route::post('/register', [RegisterController::class, 'index'])->name('register.index');

// 大屏
Route::prefix('screens')->group(function () {
    Route::get('operation', [ScreensController::class, 'operation']);
});

// 账号登录路由（该账号系统中可能不存在）
Route::group(['middleware' => ['account.login']], function () {
    Route::prefix('qrcode_scan')->group(function () {
        Route::post('store', [QrCodeScanController::class, 'store']);
    });
    Route::prefix('account')->group(function () {
        Route::get('info', [AccountController::class, 'info']);
    });
    Route::prefix('customer_events')->group(function () {
        Route::get('status', [CustomerEventsController::class, 'status']);
        Route::get('process', [CustomerEventsController::class, 'process']);
    });
});
// 二维码扫码
// 后台路由
Route::group(['middleware' => ['user.login']], function () {

    // 服务台
    Route::prefix('dashboard')->group(function () {
        Route::get('', [DashboardController::class, 'index']);
        Route::get('todo', [DashboardController::class, 'todo']);
        Route::get('satisfaction_probability', [DashboardController::class, 'satisfactionProbability']);
        Route::get('satisfaction_form', [DashboardController::class, 'satisfactionForm']);
        Route::get('avg_service_time', [DashboardController::class, 'avgServiceTime']);
        Route::get('close_probability', [DashboardController::class, 'closeProbability']);
        Route::get('person_efficiency', [DashboardController::class, 'personEfficiency']);
    });

    // 文件上传
    Route::prefix('upload')->group(function () {
        Route::post('uploadImage', [UploadController::class, 'uploadImage']);
        Route::post('uploadFile', [UploadController::class, 'uploadFile']);
    });

    // 系统主页
    Route::prefix('index')->group(function () {
        Route::get('getMenuList', [IndexController::class, 'getMenuList']);
        Route::get('getUserInfo', [IndexController::class, 'getUserInfo']);
        Route::post('updateUserInfo', [IndexController::class, 'updateUserInfo']);
        Route::post('updatePwd', [IndexController::class, 'updatePwd']);
    });

    // 用户管理
    Route::prefix('user')->group(function () {
        Route::get('index', [UserController::class, 'index']);
        Route::get('info', [UserController::class, 'info']);
        Route::post('edit', [UserController::class, 'edit']);
        Route::post('delete', [UserController::class, 'delete']);
        Route::post('status', [UserController::class, 'status']);
        Route::post('resetPwd', [UserController::class, 'resetPwd']);
        Route::post('cid', [UserController::class, 'cid']);
        Route::post('logout', [UserController::class, 'logout']);
        Route::post('getuserbyposition', [UserController::class, 'getUserByPosition']);
    });

    // 职级管理
    Route::prefix('level')->group(function () {
        Route::get('index', [LevelController::class, 'index']);
        Route::get('info', [LevelController::class, 'info']);
        Route::post('edit', [LevelController::class, 'edit']);
        Route::post('delete', [LevelController::class, 'delete']);
        Route::post('status', [LevelController::class, 'status']);
        Route::get('getLevelList', [LevelController::class, 'getLevelList']);
        Route::post('importExcel', [LevelController::class, 'importExcel']);
        Route::get('exportExcel', [LevelController::class, 'exportExcel']);
    });

    // 岗位管理
    Route::prefix('position')->group(function () {
        Route::get('index', [PositionController::class, 'index']);
        Route::get('info', [PositionController::class, 'info']);
        Route::post('edit', [PositionController::class, 'edit']);
        Route::post('delete', [PositionController::class, 'delete']);
        Route::post('status', [PositionController::class, 'status']);
        Route::get('getPositionList', [PositionController::class, 'getPositionList']);
    });

    // 角色管理
    Route::prefix('role')->group(function () {
        Route::get('index', [RoleController::class, 'index']);
        Route::get('info', [RoleController::class, 'info']);
        Route::post('edit', [RoleController::class, 'edit']);
        Route::post('delete', [RoleController::class, 'delete']);
        Route::post('status', [RoleController::class, 'status']);
        Route::get('getRoleList', [RoleController::class, 'getRoleList']);
        Route::get('getPermissionList', [RoleController::class, 'getPermissionList']);
        Route::post('savePermission', [RoleController::class, 'savePermission']);
    });

    // 菜单管理
    Route::prefix('menu')->group(function () {
        Route::get('index', [MenuController::class, 'index']);
        Route::get('info', [MenuController::class, 'info']);
        Route::post('edit', [MenuController::class, 'edit']);
        Route::post('delete', [MenuController::class, 'delete']);
        Route::get('getMenuAll', [MenuController::class, 'getMenuAll']);
    });

    // 部门管理
    Route::prefix('dept')->group(function () {
        Route::get('index', [DeptController::class, 'index']);
        Route::get('{id}/users', [DeptController::class, 'users']);
        Route::get('info', [DeptController::class, 'info']);
        Route::get('engineers', [DeptController::class, 'engineers']);
        Route::post('edit', [DeptController::class, 'edit']);
        Route::post('delete', [DeptController::class, 'delete']);
        Route::get('getDeptList', [DeptController::class, 'getDeptList']);
    });

    // 城市管理
    Route::prefix('city')->group(function () {
        Route::get('info', [CityController::class, 'info']);
        Route::post('edit', [CityController::class, 'edit']);
        Route::post('delete', [CityController::class, 'delete']);
    });

    // 字典管理
    Route::prefix('dict')->group(function () {
        Route::get('index', [DictController::class, 'index']);
        Route::get('info', [DictController::class, 'info']);
        Route::post('edit', [DictController::class, 'edit']);
        Route::post('delete', [DictController::class, 'delete']);
    });

    // 字典数据管理
    Route::prefix('dictdata')->group(function () {
        Route::get('index', [DictDataController::class, 'index']);
        Route::get('info', [DictDataController::class, 'info']);
        Route::post('edit', [DictDataController::class, 'edit']);
        Route::post('delete', [DictDataController::class, 'delete']);
        Route::post('status', [DictDataController::class, 'status']);
        Route::get('getDictByCode', [DictDataController::class, 'getDictByCode']);
        Route::get('getDictDataByCode', [DictDataController::class, 'getDictDataByCode']);
    });

    // 配置管理
    Route::prefix('config')->group(function () {
        Route::get('index', [ConfigController::class, 'index']);
        Route::get('info', [ConfigController::class, 'info']);
        Route::post('edit', [ConfigController::class, 'edit']);
        Route::post('delete', [ConfigController::class, 'delete']);
    });
//客户行业

    // 配置项管理
    Route::prefix('configdata')->group(function () {
        Route::get('index', [ConfigDataController::class, 'index']);
        Route::get('info', [ConfigDataController::class, 'info']);
        Route::post('edit', [ConfigDataController::class, 'edit']);
        Route::post('delete', [ConfigDataController::class, 'delete']);
        Route::post('status', [ConfigDataController::class, 'status']);
    });

    // 通知公告
    Route::prefix('notice')->group(function () {
        Route::get('index', [NoticeController::class, 'index']);
        Route::get('info', [NoticeController::class, 'info']);
        Route::post('edit', [NoticeController::class, 'edit']);
        Route::post('delete', [NoticeController::class, 'delete']);
        Route::post('status', [NoticeController::class, 'status']);
        Route::post('setIsTop', [NoticeController::class, 'setIsTop']);
    });

    // 站点管理
    Route::prefix('item')->group(function () {
        Route::get('index', [ItemController::class, 'index']);
        Route::get('info', [ItemController::class, 'info']);
        Route::post('edit', [ItemController::class, 'edit']);
        Route::post('delete', [ItemController::class, 'delete']);
        Route::post('status', [ItemController::class, 'status']);
        Route::get('getItemList', [ItemController::class, 'getItemList']);
    });

    // 栏目管理
    Route::prefix('itemcate')->group(function () {
        Route::get('index', [ItemCateController::class, 'index']);
        Route::get('info', [ItemCateController::class, 'info']);
        Route::post('edit', [ItemCateController::class, 'edit']);
        Route::post('delete', [ItemCateController::class, 'delete']);
        Route::post('status', [ItemCateController::class, 'status']);
        Route::get('getCateList', [ItemCateController::class, 'getCateList']);
    });

    // 广告位管理
    Route::prefix('adsort')->group(function () {
        Route::get('index', [AdSortController::class, 'index']);
        Route::get('info', [AdSortController::class, 'info']);
        Route::post('edit', [AdSortController::class, 'edit']);
        Route::post('delete', [AdSortController::class, 'delete']);
        Route::get('getAdSortList', [AdSortController::class, 'getAdSortList']);
    });

    // 广告管理
    Route::prefix('ad')->group(function () {
        Route::get('index', [AdController::class, 'index']);
        Route::get('info', [AdController::class, 'info']);
        Route::post('edit', [AdController::class, 'edit']);
        Route::post('delete', [AdController::class, 'delete']);
        Route::post('status', [AdController::class, 'status']);
    });

    // 布局描述
    Route::prefix('layoutdesc')->group(function () {
        Route::get('index', [LayoutDescController::class, 'index']);
        Route::get('info', [LayoutDescController::class, 'info']);
        Route::post('edit', [LayoutDescController::class, 'edit']);
        Route::post('delete', [LayoutDescController::class, 'delete']);
        Route::get('getLayoutDescList', [LayoutDescController::class, 'getLayoutDescList']);
    });

    // 布局管理
    Route::prefix('layout')->group(function () {
        Route::get('index', [LayoutController::class, 'index']);
        Route::get('info', [LayoutController::class, 'info']);
        Route::post('edit', [LayoutController::class, 'edit']);
        Route::post('delete', [LayoutController::class, 'delete']);
    });

    // 友链管理
    Route::prefix('link')->group(function () {
        Route::get('index', [LinkController::class, 'index']);
        Route::get('info', [LinkController::class, 'info']);
        Route::post('edit', [LinkController::class, 'edit']);
        Route::post('delete', [LinkController::class, 'delete']);
        Route::post('status', [LinkController::class, 'status']);
    });

    // 文章管理
    Route::prefix('article')->group(function () {
        Route::get('index', [ArticleController::class, 'index']);
        Route::get('info', [ArticleController::class, 'info']);
        Route::post('edit', [ArticleController::class, 'edit']);
        Route::post('delete', [ArticleController::class, 'delete']);
        Route::post('status', [ArticleController::class, 'status']);
    });

    // 会员等级
    Route::prefix('memberlevel')->group(function () {
        Route::get('index', [MemberLevelController::class, 'index']);
        Route::get('info', [MemberLevelController::class, 'info']);
        Route::post('edit', [MemberLevelController::class, 'edit']);
        Route::post('delete', [MemberLevelController::class, 'delete']);
        Route::get('getMemberLevelList', [MemberLevelController::class, 'getMemberLevelList']);
    });

    // 会员管理
    Route::prefix('member')->group(function () {
        Route::get('index', [MemberController::class, 'index']);
        Route::get('info', [MemberController::class, 'info']);
        Route::post('edit', [MemberController::class, 'edit']);
        Route::post('delete', [MemberController::class, 'delete']);
        Route::post('status', [MemberController::class, 'status']);
    });

    // 登录日志
    Route::prefix('loginlog')->group(function () {
        Route::get('index', [LoginLogController::class, 'index']);
        Route::post('delete', [LoginLogController::class, 'delete']);
    });

    // 操作日志
    Route::prefix('actionlog')->group(function () {
        Route::get('index', [ActionLogController::class, 'index']);
        Route::post('delete', [ActionLogController::class, 'delete']);
    });

    // 代码生成器
    Route::prefix('generate')->group(function () {
        Route::get('index', [GenerateController::class, 'index']);
        Route::post('generate', [GenerateController::class, 'generate']);
        Route::post('batchGenerate', [GenerateController::class, 'batchGenerate']);
    });

    // 网站配置
    Route::prefix('configweb')->group(function () {
        Route::get('index', [ConfigWebController::class, 'index']);
        Route::post('edit', [ConfigWebController::class, 'edit']);
    });

    // 组织机构
    Route::prefix('organization')->group(function () {
        Route::get('index', [OrganizationController::class, 'index']);
        Route::get('info', [OrganizationController::class, 'info']);
        Route::post('edit', [OrganizationController::class, 'edit']);
        Route::post('delete', [OrganizationController::class, 'delete']);
    });

    // 脚本数据
    Route::prefix('test')->group(function () {
        Route::get('index', [TestController::class, 'index']);
    });

    // 商品分类
    Route::prefix('categories')->group(function () {
        Route::get('', [CategoryController::class, 'index']);
        Route::get('tree', [CategoryController::class, 'tree']);
        Route::get('{id}', [CategoryController::class, 'show']);
        Route::post('', [CategoryController::class, 'store']);
        Route::put('{id}', [CategoryController::class, 'update']);
        Route::delete('{id}', [CategoryController::class, 'destroy']);
    });

    // 商品品牌
    Route::prefix('brands')->group(function () {
        Route::get('', [BrandsController::class, 'index']);
        Route::post('', [BrandsController::class, 'store']);
        Route::get('{id}', [BrandsController::class, 'show']);
        Route::put('{id}', [BrandsController::class, 'update']);
        Route::delete('{id}', [BrandsController::class, 'destroy']);
    });

    // 配件
    Route::prefix('boms')->group(function () {
        Route::get('', [BomsController::class, 'index']);
        Route::get('{id}', [BomsController::class, 'show']);
        Route::post('', [BomsController::class, 'store']);
        Route::put('{id}', [BomsController::class, 'update']);
        Route::delete('{id}', [BomsController::class, 'destroy']);
    });

    // 商品类型
    Route::prefix('product_types')->group(function () {
        Route::get('', [ProductTypesController::class, 'index']);
        Route::post('', [ProductTypesController::class, 'store']);
        Route::get('params', [ProductTypesController::class, 'params']);
        Route::get('{id}', [ProductTypesController::class, 'show']);
        Route::put('{id}', [ProductTypesController::class, 'update']);
        Route::delete('{id}', [ProductTypesController::class, 'destroy']);
    });

    // 二维码
    Route::prefix('qr_code')->group(function () {
        Route::get('', [QrCodesController::class, 'index']);
        Route::post('', [QrCodesController::class, 'store']);
        Route::get('{id}', [QrCodesController::class, 'show']);
        Route::put('{id}', [QrCodesController::class, 'update']);
        Route::delete('{id}', [QrCodesController::class, 'destroy']);
    });

    Route::get('qr_code_search', [QrCodesController::class, 'search']);
    Route::post('qr_code_generate', [QrCodesController::class, 'generate']);

    Route::prefix('qr_code_export')->group(function () {
        Route::get('', [QrCodesController::class, 'export']);
    });

    // 商品
    Route::prefix('products')->group(function () {
        Route::get('', [ProductsController::class, 'index']);
        Route::post('', [ProductsController::class, 'store']);
        Route::get('params', [ProductsController::class, 'params']);
        Route::get('{id}', [ProductsController::class, 'show']);
        Route::put('{id}', [ProductsController::class, 'update']);
        Route::delete('{id}', [ProductsController::class, 'destroy']);
    });

    // 客户
    Route::get('customers_export', [CustomersController::class, 'export']);
    Route::prefix('customers')->group(function () {
        Route::get('', [CustomersController::class, 'index']);
        Route::post('', [CustomersController::class, 'store']);
        Route::post('{id}/user', [CustomersController::class, 'store_user']);
        Route::get('params', [CustomersController::class, 'params']);
        Route::get('{id}', [CustomersController::class, 'show']);
        Route::get('{id}/users', [CustomersController::class, 'users']);
        Route::get('{id}/products', [CustomersController::class, 'products']);
        Route::put('{id}', [CustomersController::class, 'update']);
        Route::put('{id}/default_user', [CustomersController::class, 'default_user']);
        Route::delete('{id}', [CustomersController::class, 'destroy']);
        Route::delete('', [CustomersController::class, 'destroy_batch']);
    });

    // 客户联系人
    Route::prefix('customer_users')->group(function () {
        Route::get('', [CustomerUsersController::class, 'index']);
        Route::post('', [CustomerUsersController::class, 'store']);
        Route::get('params', [CustomerUsersController::class, 'params']);
        Route::get('info_phone/{phone}', [CustomerUsersController::class, 'info_phone']);
        Route::get('{id}', [CustomerUsersController::class, 'show']);
        Route::put('{id}', [CustomerUsersController::class, 'update']);
        Route::delete('{id}', [CustomerUsersController::class, 'destroy']);
    });

    // 事件
    Route::prefix('events')->group(function () {
        Route::get('', [EventsController::class, 'index']);
        Route::post('', [EventsController::class, 'store']);
        Route::get('params', [EventsController::class, 'params']);
        Route::get('{id}', [EventsController::class, 'show']);
        Route::get('{id}/work_order', [EventsController::class, 'work_order']);
        Route::post('{id}/allot', [EventsController::class, 'allot']);
        Route::post('{id}/start', [EventsController::class, 'start']);
        Route::post('{id}/receipt', [EventsController::class, 'receipt']);
        Route::post('{id}/correlation', [EventsController::class, 'correlation']);
    });

    //产品管理
    Route::get('products_export', [ProductsController::class, 'export']);
    Route::prefix('product')->group(function () {
        Route::get('index', [ProductController::class, 'index']);
        Route::get('info', [ProductController::class, 'info']);
        Route::post('edit', [ProductController::class, 'edit']);
        Route::post('delete', [ProductController::class, 'delete']);
        Route::post('status', [ProductController::class, 'status']);
    });

    //系统升级
    Route::prefix('common')->group(function () {
        Route::get('up_version', [CommonController::class, 'up_version']);
    });


});
